package com.pp.demo.common.security;

import lombok.Data;
import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Configuration;

import java.util.Map;

@Slf4j
@Configuration
@ConfigurationProperties(prefix = "auth.all")
@Data
public class AuthProperties {

    private Map<String, String> apps; // AppID -> Secret 映射

    public boolean isValidApp(String appId) {
        return apps.containsKey(appId);
    }

    public String getSecret(String appId) {
        return apps.get(appId);
    }
}
